package com.eff.android.fragment.options;

import com.eff.android.R;
import com.eff.android.fragment.EBaseFragment;
import com.eff.android.fragment.IFragmentCallback;
import com.eff.android.lib.ui.EButton;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;

public class EMainFragmentOptions extends EBaseFragment{
	public static final String TAG = EMainFragmentOptions.class.getSimpleName();
	
	EMainFragmentOptionsSubjects eMainOptionsSubjects;
	EButton btnType;
	EButton btnSubjects;
	
	private IFragmentCallback callback;
	
	public static EMainFragmentOptions newInstance(Context context, Bundle b) {
		EMainFragmentOptions f = new EMainFragmentOptions();
		if (b != null){
		    f.setArguments(b);
		}
		return f;
	}

	public static Bundle getArgs() {
		Bundle b = new Bundle();
		b.putString(TAG, TAG);
		return b;
	}

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		initFragment();
	}
	
	private void initFragment(){
		eMainOptionsSubjects = new EMainFragmentOptionsSubjects();
	}

	
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
	    Bundle savedInstanceState) {
		super.onCreateView(inflater, container, savedInstanceState);
		
		View v = inflater.inflate(R.layout.e_frm_main_options, container, false);
		initViews(v);
		
		btnSubjects = (EButton)v.findViewById(R.id.btnSubjects);
		btnSubjects.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				getCallback().gotoNextPage(eMainOptionsSubjects);
			}
		});
		    
		return v;
    }

	private void initViews(View v) {
		// TODO Auto-generated method stub
		
	}

	public IFragmentCallback getCallback() {
		return callback;
	}

	public void setCallback(IFragmentCallback callback) {
		this.callback = callback;
	}
}
